package org.example;

public class Duration {
    private int hours;
    private int minutes;
    private int seconds;

    public Duration(int minutes, int hours, int seconds) {
        this.minutes = minutes;
        this.hours = hours;
        this.seconds = seconds;
    }

    public Duration(int totalSeconds) {
        hours = totalSeconds / 3600;
        minutes = (totalSeconds % 3600) / 60;
        seconds = (totalSeconds % 3600) % 60;

    }

    public int getHours() {
        return hours;
    }

    public int getSeconds() {
        return seconds;
    }

    public int getMinutes() {
        return minutes;
    }

    public int getTotalSeconds(){
        return hours * 3600 + minutes * 60 + seconds;
    }

    public String toString(){
        System.out.println(hours + ":" + minutes + ":" + seconds);
    }
}
